﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Workflows.Components.TextMining.Collapse
{
    [Serializable]
    [AttributeUsage(AttributeTargets.Class)]
    public class CollapsibleObjectAttribute : Attribute
    {
        #region fields
        private Type _EntityType;
        private string _KeyName;
        private string _CollapsedKeyFieldName;
        private double _CollapseCutoffScore;
        private bool _MaximizeCombinedFieldScore;
        #endregion

        public CollapsibleObjectAttribute(Type entityType, string keyName, double cutoffScore, bool maximizeFieldEvalScore)
        {
            this._EntityType = entityType;
            this._KeyName = keyName;
            this._CollapseCutoffScore = cutoffScore;
            this._MaximizeCombinedFieldScore = maximizeFieldEvalScore;
        }

        #region props
        public Type EntityType
        {
            get { return _EntityType; }
            set { _EntityType = value; }
        }

        public string KeyName
        {
            get { return _KeyName; }
            set { _KeyName = value; }
        }

        public double CollapseCutoffScore
        {
            get { return _CollapseCutoffScore; }
            set { _CollapseCutoffScore = value; }
        }

        /// <summary>
        /// true  => Score = Sum(Max(FieldEvalScore))
        /// false => Score = Max(Sum(FieldEvalScore))
        /// </summary>
        public bool MaximizeCombinedFieldScore
        {
            get { return _MaximizeCombinedFieldScore; }
            set { _MaximizeCombinedFieldScore = value; }
        }

        public string CollapsedKeyFieldName
        {
            get { return _CollapsedKeyFieldName; }
            set { _CollapsedKeyFieldName = value; }
        }

        #endregion
    }
}
